	<html>
	<title> Health Promotion | Add</title>
		<link rel="stylesheet" href="style.css"/>
		<body class="pageBody">
			
			
	<?php
	include_once("health_promo_class.php");
	$obj=new health_promo_class();
	 //$idhealth_promotion="";
	 

	//checking for the presence of parameters
	if(!isset($_REQUEST['date'], $_REQUEST['venue'], $_REQUEST['topic'], $_REQUEST['method'], $_REQUEST['target_audience'], 
	$_REQUEST['number_of_audience'], $_REQUEST['remarks'], $_REQUEST['month'], $_REQUEST['latitude'], $_REQUEST['longitude'],
	$_REQUEST['image'], $_REQUEST['id_cho'], $_REQUEST['subdistrict_id']))
	{
		echo "Please insert some values!";
	}
	
    if(isset($_REQUEST['date'], $_REQUEST['venue'], $_REQUEST['topic'], $_REQUEST['method'], $_REQUEST['target_audience'], 
	$_REQUEST['number_of_audience'], $_REQUEST['remarks'], $_REQUEST['month'], $_REQUEST['latitude'], $_REQUEST['longitude'],
	$_REQUEST['image'], $_REQUEST['id_cho'], $_REQUEST['subdistrict_id']))
	{
	
	$date=$_REQUEST['date'];
    $venue=$_REQUEST['venue'];
    $topic=$_REQUEST['topic'];
    $method=$_REQUEST['method'];
    $target_audience=$_REQUEST['target_audience'];
    $number_of_audience=$_REQUEST['number_of_audience'];
    $remarks=$_REQUEST['remarks'];
    $month=$_REQUEST['month'];
    $latitude=$_REQUEST['latitude'];
    $longitude=$_REQUEST['longitude'];
    $image=$_REQUEST['image'];
    $id_cho=$_REQUEST['id_cho'];
    $subdistrict_id=$_REQUEST['subdistrict_id'];
	
	$obj->add_health_promo($date, $venue, $topic, $method, $target_audience, $number_of_audience, $remarks, $month,
			$latitude, $longitude, $image, $id_cho, $subdistrict_id);
			echo "New promotion recorded successfully!";
			echo "Click on button below to go back to homepage.";
	
	if(!$obj->add_health_promo($date, $venue, $topic, $method, $target_audience, $number_of_audience,
	 $remarks, $month, $latitude, $longitude, $image, $id_cho, $subdistrict_id)){
	 	echo "error!";
		mysql_error();
		exit();
	  } 
	}
	
	
?>
		
<!--		/**
 * author: Kwadwo Busumtwi	
 * date: 19/2/2014
 * description: Form for insertion into the promotion database
 */-->
				<br><br/><br>


					<form action="health_promotion_home.php" method="GET">
						<input type="submit" value="Back to home" name="his_home"/>
					</form>
					
	 					<table class="listTable" width='50%' align='center'>
							<tr>
								<td colspan="2" id="pageheader">
									Health Promotion Add Page
								</td>
							</tr>
	 						<form action="Promotion_Form.php" method="GET">
								<tr>
									<td class="label">Date: </td>
									<td class="field"><input type="date" name="date" ></td>
								</tr>
								<tr>
									<td class="label">Venue: </td>
									<td class="field"><input type="text" name="venue" ></td>
								</tr
								<tr>
									<td class="label">Topic: </td>
									<td class="field"><input type="text" name="topic" ></td>
								</tr>
								<tr>
									<td class="label">Method: </td>
									<td class="field"><input type="text" name="method" ></td>
								</tr>
								<tr>
									<td class="label">Target Audience: </td>
									<td class="field"><input type="text" name="target_audience" ></td>
								</tr>
								<tr>
									<td class="label">Number of Audience: </td>
									<td class="field"><input type="text" name="number_of_audience" ></td>
								</tr
								<tr>
									<td class="label">Remarks: </td>
									<td class="field"><input type="text" name="remarks" >
								</tr>
								<tr>
									<td class="label">Month: </td>
									<td class="field"><input type="month" name="month">
								</tr>
								<tr>
									<td class="label">Latitude: </td>
									<td class="field"><input type="text" name="latitude" >
								</tr>
								<tr>
									<td class="label">Longitude: </td>
									<td class="field"><input type="text" name="longitude" >
								</tr>
								<tr>
									<td class="label">Image: </td>
									<td class="field"><input type="text" name="image" >
								</tr>
								<tr>
									<td class="label">IDcho: </td>
									<td class="field"><input type="text" name="id_cho" >
								</tr>
								<tr>
									<td class="label">Subdistrict ID: </td>
									<td class="field"><input type="text" name="subdistrict_id" >
								</tr>
								<tr>
									<td class="label"></td>
									<td class="field">
										<input type="submit" value="Submit" name="submit_button" >
								</tr>
		
							</form>	
							
							
						</table>
						
						
	
		
		</body>
		
</html>

